package bocchi.base;

import bocchi.BocchiCore;
import bocchi.general.ResourcePath;
import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.helpers.ImageMaster;
import com.megacrit.cardcrawl.localization.PowerStrings;
import com.megacrit.cardcrawl.powers.AbstractPower;

import static com.megacrit.cardcrawl.core.CardCrawlGame.*;

public abstract class BaseCustomPower extends AbstractPower {
    protected final PowerStrings powerStrings;
    protected final String[] descriptions;

    public BaseCustomPower(String rawID, PowerType type, AbstractCreature owner, int amount) {
        ID = BocchiCore.getGameID(rawID);
        powerStrings = languagePack.getPowerStrings(ID);
        descriptions = powerStrings.DESCRIPTIONS;
        name = powerStrings.NAME;

        this.type = type;
        this.owner = owner;
        this.amount = amount;

        String path128 = ResourcePath.POWER + "Default84.png";
        String path48 = ResourcePath.POWER + "Default32.png";
        this.region128 = new AtlasRegion(ImageMaster.loadImage(path128), 0, 0, 84, 84);
        this.region48 = new AtlasRegion(ImageMaster.loadImage(path48), 0, 0, 32, 32);

        updateDescription();
    }

    public BaseCustomPower(String rawID, PowerType type, AbstractCreature owner) {
        this(rawID, type, owner, -1);
    }

    public static PowerStrings getPowerStrings(String rawID) {
        return languagePack.getPowerStrings(BocchiCore.getGameID(rawID));
    }

    public void onFinale() {}
}
